<% error = @user.errors.include?(:username) %>
<fieldset class='control-group <%= error ? 'has-error' : ''%>'>
  <%= f.label :username, :class => 'control-label' %>
  <div class='controls'>
    <%= f.text_field :username, :class => 'form-control input-xlarge input-with-feedback', :autofocus => true %>
    <span class='help-inline'><%= error ? f.error_message_on(:username) : "Ex: a simple text" %></span>
  </div>
</fieldset>
<% error = @user.errors.include?(:crypted_pass) %>
<fieldset class='control-group <%= error ? 'has-error' : ''%>'>
  <%= f.label :crypted_pass, :class => 'control-label' %>
  <div class='controls'>
    <%= f.text_field :crypted_pass, :class => 'form-control input-xlarge input-with-feedback' %>
    <span class='help-inline'><%= error ? f.error_message_on(:crypted_pass) : "Ex: a simple text" %></span>
  </div>
</fieldset>
<% error = @user.errors.include?(:email) %>
<fieldset class='control-group <%= error ? 'has-error' : ''%>'>
  <%= f.label :email, :class => 'control-label' %>
  <div class='controls'>
    <%= f.text_field :email, :class => 'form-control input-xlarge input-with-feedback' %>
    <span class='help-inline'><%= error ? f.error_message_on(:email) : "Ex: a simple text" %></span>
  </div>
</fieldset>
<% error = @user.errors.include?(:mobile) %>
<fieldset class='control-group <%= error ? 'has-error' : ''%>'>
  <%= f.label :mobile, :class => 'control-label' %>
  <div class='controls'>
    <%= f.text_field :mobile, :class => 'form-control input-xlarge input-with-feedback' %>
    <span class='help-inline'><%= error ? f.error_message_on(:mobile) : "Ex: a simple text" %></span>
  </div>
</fieldset>
<% error = @user.errors.include?(:crypted_password) %>
<fieldset class='control-group <%= error ? 'has-error' : ''%>'>
  <%= f.label :crypted_password, :class => 'control-label' %>
  <div class='controls'>
    <%= f.text_field :crypted_password, :class => 'form-control input-xlarge input-with-feedback' %>
    <span class='help-inline'><%= error ? f.error_message_on(:crypted_password) : "Ex: a simple text" %></span>
  </div>
</fieldset>


<div class="form-actions">
  <%= f.submit pat(:save), :class => 'btn btn-primary' %>
  &nbsp;
  <%= f.submit pat(:save_and_continue), :class => 'btn btn-info', :name => 'save_and_continue' %>
  &nbsp;
  <%= link_to pat(:cancel), url(:users, :index), :class => 'btn btn-default' %>
</div>